package com.thread.test11;

/**
 * @author bin
 * @date 2025 - 03 -12
 **/
public class Print {
    private User user;

    public Print() {
    }

    public Print(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public synchronized void print() {
        System.out.println(user.getName() + ":" + user.getMsg());
    }
}
